package com.zhoutao.blog.seven.dao.repository;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhoutao.blog.seven.dao.mapper.MenuMapper;
import com.zhoutao.blog.seven.dao.model.MenuDao;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

import java.util.List;

@Slf4j
@Repository
public class MenuRepository extends ServiceImpl<MenuMapper, MenuDao> {

    public List<MenuDao> all() {
        LambdaQueryWrapper<MenuDao> wrapper = new LambdaQueryWrapper<>();
        wrapper.orderByAsc(MenuDao::getOrdinal);
        return this.baseMapper.selectList(wrapper);
    }
}
